<?php

namespace app\modules\admin\forms\merchant;

use app\common\forms\BaseForm;

class MerchantInfoForm extends BaseForm{

    public $reg_name;
    public $ico;
    public $reg_address;
    public $contact_name;
    public $contact_phone;

    public function scenarios()
    {
        return [
            'create'=>[
                'reg_name','ico','reg_address','contact_name','contact_phone'
            ],
            'update'=>[
                'reg_name','ico','reg_address','contact_name','contact_phone'
            ]
        ];
    }

    public function rules()
    {
        return [
            ['reg_name','required','on'=>['create','update'],'message'=>\Yii::t("app","注册名称不能为空")],
            ['ico','required','on'=>['create','update'],'message'=>\Yii::t("app","ICO税号不能为空")],
            ['reg_address','required','on'=>['create','update'],'message'=>\Yii::t("app","注册地址不能为空")],
            ['contact_name','required','on'=>['create','update'],'message'=>\Yii::t("app","联系人不能为空")],
            ['contact_phone','required','on'=>['create','update'],'message'=>\Yii::t("app","联系电话不能为空")],
        ];
    }
}